<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<html>
	<head>


		<title>代理列表</title>
		<%
			request.setCharacterEncoding("UTF-8");
		%>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="../css/style.css" type="text/css"></link>
		<script type="text/javascript" src="../scripts/md5/md5-min.js"></script>

		<script type="text/javascript">
		
		
     function addAgent(id){
       document.getElementById(id).style.display="block";
     }
     function disDiv(id){
     document.getElementById(id).style.display="none";
     }
     function deleteAgent(id){
		 if(confirm('确定要删除吗?'+id)){
			document.all('agent.uno').value=id;
		    document.getElementById("dform").submit();
		 }
      }
      
      
    /**  function CreateSub(){
        
         var result=hex_md5(document.getElementById("agent.upwd").value);
         alert(result);
         document.getElementById("agent.upwd").value=result;
         document.getElementById("createForm").submit();
      }*/

   </script>


	</head>

	<body>
		<div>
			<input type="button" value="新增下级代理" onclick="addAgent('addAgent')" />
		</div>
		<div>
			<table width="100%" style="border-width: 1px; border-style: solid;">
				<tr align="center">
					<td>
						登录名
					</td>
					<td>
						真实姓名
					</td>
					<td>
						电话
					</td>
					<td>
						基本额度
					</td>
					<td>
						剩余额度
					</td>
					<td>
						状态
					</td>
					<td>
						操作
					</td>
				</tr>
				<s:iterator value="pager.data">
					<tr align="center">
						<td>
							<s:property value="uname" />
						</td>
						<td>
							<s:property value="trueName" />
						</td>
						<td>
							<s:property value="tel" />
						</td>
						<td>
							<s:property value="baseAmount" />
						</td>
						<td>
							<s:property value="balance" />
						</td>
						<td>
							<s:property value="status" />
						</td>
						<td>
							<a
								href="/newbingo/test/Agent_findBetSetting.action?agentId=${uno }&gamePlayId=2">设置投注限额</a>&nbsp;
							<a href="/newbingo/test/Agent_findById.action?agent.uno=${uno}">修改</a>&nbsp;
							<a href="javascript:deleteAgent(${uno })">删除</a>&nbsp;
							<a
								href="/newbingo/test/Agent_findOperationLog.action?agentId=${uno }">历史操作</a>&nbsp;
							<s:if test="status=='冻结'">
								<a
									href="/newbingo/test/Agent_updateStatus.action?agent.uno=${uno }&agent.status=正常">可用</a>
							</s:if>
							<s:if test="status=='正常'">
								<a
									href="/newbingo/test/Agent_updateStatus.action?agent.uno=${uno }&agent.status=冻结">禁用</a>
							</s:if>
						</td>
					</tr>
				</s:iterator>
			</table>
		</div>
		<form id="dform" action="/newbingo/test/Agent_delete.action"
			method="post">
			<input type="hidden" name="agent.uno" />
		</form>
		<div id="addAgent" style="display: block;">
			<form action="/newbingo/test/Agent_create.action" method="post"
				id="createForm">
				新增代理：
				<input type="hidden" value="0" name="agent.agentType" />
				<input type="hidden" value="${user.uno }"
					name="agent.parentAgent.uno" />
				<table>
					<tr>
						<td>
							登录名：
						</td>
						<td>
							<input name="agent.uname" />
						</td>
					</tr>
					<tr>
						<td>
							密码：
						</td>
						<td>
							<input id="agent.upwd" name="agent.upwd" type="password" />
						</td>
					</tr>
					<tr>
						<td>
							真实姓名：
						</td>
						<td>
							<input name="agent.trueName" />
						</td>
					</tr>
					<tr>
						<td>
							电话：
						</td>
						<td>
							<input name="agent.contactInfo.tel" />
						</td>
					</tr>
					<tr>
						<td>
							Email：
						</td>
						<td>
							<input name="agent.contactInfo.email" />
						</td>
					</tr>
				</table>
				<input type="submit" value="保存"  />
				&nbsp;&nbsp;
				<input type="button" value="取消" onclick="disDiv('addAgent')" />
			</form>
		</div>
	</body>
</html>
